import { createRouter, createWebHistory } from 'vue-router'
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'
import test1 from '../views/test1.vue'
import test2 from '../views/test2.vue'
import { KeepAlive } from 'vue'

const router = createRouter({
  history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? '/sub2-app/' : '/'),
  routes: [
    {
      path: '/',
      redirect: '/test1',
    },
    {
      path: '/test1',
      name: 'test1',
      component: test1,
      meta:{
        KeepAlive:true
      }
    },
    {
      path: '/test2',
      name: 'test2',
      component: test2,
      meta:{
        KeepAlive:true
      }
    },
  ],
})

export default router
